# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=gef
pkgver=2022.06
pkgrel=3
pkgdesc='Multi-Architecture GDB Enhanced Features for Exploiters & Reverse-Engineers'
url='https://github.com/hugsy/gef'
arch=('any')
license=('MIT')
depends=('gdb' 'python')
optdepends=(
  'python-capstone: extended disassemble support'
  'python-keystone: assembler support'
  'python-unicorn: emulation support'
  'ropgadget: ROP gadget support'
)
source=(https://github.com/hugsy/gef/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz.tar.gz)
sha512sums=('585bad8655a5208d060b1ccf455ab87527e47949fce1df188a5ac970ccd1bbfbdd87151f7a940edcfb879dd0ea846b5c4a8650fed856cd5dcaec0ddd3581f100')
b2sums=('b7038e0519f216669c38bdda7e12375fb1c9e5278c8b617df73932a750ee6552531929eebcac22321607f51592834ece70c850ce0ba4629bc383731bc8803bb3')

build() {
  cd ${pkgname}-${pkgver}
  python -m compileall .
  python -O -m compileall .
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 644 *.py -t "${pkgdir}/usr/share/${pkgname}"
  install -Dm 644 __pycache__/* -t "${pkgdir}/usr/share/${pkgname}/__pycache__"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r docs/* "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
